Triple Methods

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Syntax

C#
[SerializableAttribute]
public struct Triple<TFirst, TSecond, TThird>
Visual Basic (Declaration)
<SerializableAttribute> _
Public Structure Triple(Of TFirst, TSecond, TThird)
Visual C++
[SerializableAttribute]
generic<typename TFirst, typename TSecond, typename TThird>
public value class Triple

Type Parameters

TFirst
TSecond
TThird

The type exposes the following methods.

Public Methods

  NameDescription
Public methodCompareTo

Compares this triple to another triple of the some type. The triples are compared by using the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples are compared by their first elements first, if their first elements are equal, then they are compared by their second elements. If their second elements are also equal, then they are compared by their third elements.

If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then an NotSupportedException is thrown, because the triples cannot be compared.

Public operatorStatic memberEquality
Determines if two triples are equal. Two triples are equal if the all three elements compare equal using IComparable<T>.Equals or object.Equals.
Public methodEqualsOverloaded.
Public methodGetHashCode
Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. Two triples that compare equal (using Equals) will have the same hash code. The hash code for the triple is derived by combining the hash codes for each of the two elements of the triple.
(Overrides ValueType..::GetHashCode()().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public operatorStatic memberInequality
Determines if two triples are not equal. Two triples are equal if the all three elements compare equal using IComparable<T>.Equals or object.Equals.
Public methodToString
Returns a string representation of the triple. The string representation of the triple is of the form: First: {0}, Second: {1}, Third: {2} where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and {2} is the result of Third.ToString() (or "null" if they are null.)
(Overrides ValueType..::ToString()().)

Protected Methods

  NameDescription
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)

Explicit Interface Implementations

  NameDescription
Explicit interface implemetationPrivate methodIComparable..::CompareTo

Compares this triple to another triple of the some type. The triples are compared by using the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples are compared by their first elements first, if their first elements are equal, then they are compared by their second elements. If their second elements are also equal, then they are compared by their third elements.

If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then an NotSupportedException is thrown, because the triples cannot be compared.

See Also